from django.shortcuts import render
from django.http import HttpResponse
from obs.mongo_log import OBSLog
# Create your views here.
def find_log(request, package_id):
    print(package_id)
    o = OBSLog()
    if o.is_package_exist(package_id):
        log = o.get_latest_log(package_id)
        return HttpResponse(log, content_type='text/plain; charset=gbk')
    else:
        raise Exception("Package not found")

